<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		<h1 id="h1"></h1>
		
		<button onclick="showTxt();">showText</button>
		
		<button onclick="showColor()">changeColor</button>
		
		<button onclick="showFontSize()">changeFontSize</button>
		
		<button onclick="showBackColor()">changeBackColor</button>
		
		<button onclick="move()">move</button>
		
		
		<script>
			
			var h1 = document.getElementById('h1');
		
			function sayHello(name) {
				//console.log('hello ' + name);
				return 'hello ' + name;
				//return 'hello ' + name + ' ' + age;
			};
			
			function showTxt() {
				h1.innerHTML = sayHello('js');
			}
			
			function showColor() {
				h1.style.color = 'orangered';
			}
			
			function showFontSize() {
				h1.style.fontSize = '30px';
			}
			
			function showBackColor() {
				h1.style.backgroundColor = 'lightskyblue';
			}
			
			function move() {
				h1.style.display = 'inline-block';
				h1.style.position = 'relative';
				h1.style.bottom = '-300px';
				h1.style.left = '300px';
			}
			/*
			
			function addZero(num) {  //形参
				//var x;
				//当作方法
				if(num < 10) {
					num = '0' + num;
				}
				console.log(num);
				
				//当作值
				return num;
			};
			addZero(8);*/
			//h1.innerHTML = addZero(8);  //实参
			
			
			//函数声明
			//alert(sayHello('wbc', 1.3));   //alert
			//console.log(sayHello('wbc', 1.3));  //console.log
			
			/*console.log(sayHello('张三', 27))
			
			function sayHello(name, age) {
				//console.log('hello ' + name + ' ' + age);
				return 'hello ' + name + ' ' + age;
			};*/
			
			//h1.innerHTML = sayHello('wbc', 1.3);
			
			//console.log(sayHello('wbc', 1.3));

			/*var x = 'abc';
			var y = 'x';
				y = x;
			console.log(y)*/
			
			//函数表达式
			/*var sayName = function() {
				alert('张三');
			};
			sayName();*/
			
			//alert('adaa');
		</script>
	</body>
</html>
